package org.stone.project.servce;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.stone.project.dao.UserInfoDao;
import org.stone.project.domain.UserInfo;
import reactor.core.publisher.Mono;

@Service
public class DemoService {
    @Autowired
    private UserInfoDao userInfoDao;

    @Transactional
    public Mono<UserInfo> saveDt(UserInfo userInfo){
        return userInfoDao.save(userInfo)
                .doOnNext(ele->{
                    throw new IllegalArgumentException("error");
                });
    }

}
